package work1.bank;

public class Bank {
    private String bName;
    private String pName;
    private int password;
    private double abalance;
    private int turnover;

    public void setbName(String bName) {
        this.bName = bName;
    }
    public String getbName() {
        return bName;
    }



    public void setpName(String pName) {
        this.pName = pName;
    }
    public String getpName() {
        return pName;
    }
    public void setPassword(int password) {
        this.password = password;
    }
    public int getPassword() {
        return password;
    }
    public void setAbalance(double abalance) {
        this.abalance = abalance;
    }
    public double getAbalance() {
        return abalance;
    }



    public void setTurnover(int turnover) {
        this.turnover = turnover;
    }
    public int getTurnover() {
        return turnover;
    }
    Bank(){

    }
    Bank(String pName,int password,double abalance ){
        this.pName=pName;
        this.password=password;
        this.abalance=abalance;
    }


    /*欢迎*/
    void welcome(){
        System.out.println("欢迎来到"+bName+"-------------");
    }
    void unwelcome(){
        System.out.println("请携带好随身财物，欢迎下次光临"+bName+"银行"+"-------------");
    }
    /*提示余额*/
    void tip(){
        System.out.print(",账户余额"+abalance);
    }

    /*开户*/
    void open(String pName,int password,double money){
        this.pName=pName;
        this.password=password;
        abalance=money-10;
        System.out.print(pName+" 开户成功，存入"+money);
    }
    /*存款*/
    void deposit(int money){
        abalance+=money;
        System.out.println();
        System.out.print(pName+"您好，你的账户 已存入"+money+"元");
    }

    /*取款*/
    void out(int money){
        if (abalance>=money){
            abalance-=money;
            System.out.println(pName+"您好，你的账户 已取出"+money+"元"+",账户余额"+abalance);
        }
        else {
            System.out.println(pName+"对不起你账户余额不足");
        }
    }

    /*密码*/
    public boolean psw(int password){
        if (this.password==password){
            return true;
        }
        return false;
    }

    void passwords(int password){
        if (password!=this.password){
            System.out.println();
            System.out.println("密码输入错误");
        }
    }

}
